//
// Created by xkj on 2020/8/21.
//

#ifndef PROJ_ANDROID_WORDMAPPINGTIAN_H
#define PROJ_ANDROID_WORDMAPPINGTIAN_H

#include <string>

class oneWordUnit{
public:
    std::string word;
    bool isShow;

    void init(){
        word.clear();
        isShow = false;
    }


    oneWordUnit& operator=(const oneWordUnit& oneB)
    {
        // 避免自赋值
        if (this != &oneB)
        {
            word = oneB.word;
            isShow = oneB.isShow;
        }

        return *this;
    }

};

typedef std::array<oneWordUnit,6> UpTownGrid;
typedef std::array<oneWordUnit,8> DownTownGrid;

class WordMappingTian
{
public:
    WordMappingTian(){
        init();
    }

    void init(){
        pageWordsList.clear();
        wordPhraseList ={"","",""};
        leftBanner     ={"","",""};
        rightBanner    ={"","",""};
        bottomBanner   ={"","",""};
        sentence       = {"","",""};
        constitute     = {"","",""};
        idMappingGrid.clear();
/*
               for(int i=0;i<3;i++){
                   for(int j=0;j<6;j++) {
                       upTownG[i][j].init();
                   }
               }

               for(int i=0;i<3;i++){
                   for(int j=0;j<8;j++) {
                       downTownGrid[i][j].init();
                   }
               }
*/
    }

    WordMappingTian& operator=(const WordMappingTian& oneB)
    {
        // 避免自赋值
        if (this != &oneB)
        {
            pageWordsList  = oneB.pageWordsList ;
            wordPhraseList = oneB.wordPhraseList;
            leftBanner     = oneB.leftBanner    ;
            rightBanner    = oneB.rightBanner   ;
            bottomBanner   = oneB.bottomBanner  ;
            sentence       = oneB.sentence      ;
            constitute     = oneB.constitute    ;
            idMappingGrid  = oneB.idMappingGrid ;
        }

        return *this;
    }

    const std::array<std::string, 42> GridIdx={
            "tian-bihua-show-tpl-1-0",
            "tian-bihua-show-tpl-2-0",
            "tian-bihua-show-tpl-3-0",
            "tian-bihua-show-tpl-4-0",
            "tian-bihua-show-tpl-5-0",
            "tian-bihua-show-tpl-6-0",
            "tian-bihua-show-tpl-1-1",
            "tian-bihua-show-tpl-2-1",
            "tian-bihua-show-tpl-3-1",
            "tian-bihua-show-tpl-4-1",
            "tian-bihua-show-tpl-5-1",
            "tian-bihua-show-tpl-6-1",
            "tian-bihua-show-tpl-1-2",
            "tian-bihua-show-tpl-2-2",
            "tian-bihua-show-tpl-3-2",
            "tian-bihua-show-tpl-4-2",
            "tian-bihua-show-tpl-5-2",
            "tian-bihua-show-tpl-6-2",
            "cizu_word_0_1",
            "cizu_word_0_2",
            "cizu_word_0_3",
            "cizu_word_0_4",
            "cizu_word_0_5",
            "cizu_word_0_6",
            "cizu_word_0_7",
            "cizu_word_0_8",
            "cizu_word_1_1",
            "cizu_word_1_2",
            "cizu_word_1_3",
            "cizu_word_1_4",
            "cizu_word_1_5",
            "cizu_word_1_6",
            "cizu_word_1_7",
            "cizu_word_1_8",
            "cizu_word_2_1",
            "cizu_word_2_2",
            "cizu_word_2_3",
            "cizu_word_2_4",
            "cizu_word_2_5",
            "cizu_word_2_6",
            "cizu_word_2_7",
            "cizu_word_2_8"
    };

    std::string pageWordsList;
    std::array<std::string, 3>  wordPhraseList;
    std::array<std::string, 3>  leftBanner;
    std::array<std::string, 3>  rightBanner;
    std::array<std::string, 3>  bottomBanner;
    std::array<std::string, 3>  sentence;
    std::array<std::string, 3>  constitute;

    /*
    std::array<UpTownGrid, 3> upTownG;
    std::array<DownTownGrid, 3> downTownGrid;
    */
    std::map<std::string, oneWordUnit> idMappingGrid;

};

#endif //PROJ_ANDROID_WORDMAPPINGTIAN_H